package com.example.salesservice.mapper;

import com.example.salesservice.entity.Customer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CustomerImp {
	//查询所有客户（或根据筛选条件查询）
	public List<Customer> select(@Param("customername")String customername, @Param("connectionpersion")String connectionpersion, @Param("phone")String phone,
								 @Param("index")Integer index, @Param("limit")Integer limit);
	//根据available属性（= 1）查询客户
	public List<Customer> selectName();
	//录入数据库
	public void insert(@Param("customername")String customername,@Param("zip")String zip,@Param("address")String address,@Param("telephone")String telephone,@Param("connectionpersion")String connectionpersion
			,@Param("phone")String phone,@Param("bank")String bank,@Param("account")String account
			,@Param("email")String email,@Param("fax")String fax,@Param("available")Integer available);
	//更新
	public void update(@Param("id")Integer id,@Param("customername")String customername,@Param("zip")String zip,@Param("address")String address,@Param("telephone")String telephone,@Param("connectionpersion")String connectionpersion
			,@Param("phone")String phone,@Param("bank")String bank,@Param("account")String account
			,@Param("email")String email,@Param("fax")String fax,@Param("available")Integer available);
	//根据id删除
	public void delete(Integer id);
}
